<?php
/**
 * Plugin name
 *
 * A CakePHP Plugin to 
 *
 * Licensed under The MIT License
 * Redistributions of files must retain the above copyright notice.
 *
 * @author       xxx@gootop.net 
 * @copyright     Copyright 2013, gootop.net
 * @link          
 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)
 */

$plugin = 'Seat';
Configure::write("{$plugin}.app", $plugin);
Configure::write("{$plugin}.auth", 'zmx@gootop.net');
Configure::write("{$plugin}.icon", "{$plugin}.app.png");
Configure::write("{$plugin}.version", "1.0.0");



function processSeatPic($td){
	if($td['enable'] == 0){
		return 'empty.jpg';
	}else if($td['enable'] == 1){
		$seat_sold_state = isset($td['Seat']['SeatSold']['ticket_seat_sold_id'])?$td['Seat']['SeatSold']['ticket_seat_sold_id']:0; 
		if($seat_sold_state){
			if($seat_sold_state == 1){
				return 'locked.jpg';
			}else{
				return 'disabled.jpg';
			}
		} else if($td['Seat']['id']){
			return $td['Seat']['SeatType']['add_class'].'.jpg';
		}else{
			return 'disabled.jpg';
		}
	}
}